package com.guoteng.androidlearn;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class FirstActivity extends BaseActivity {

    private static int kClassCount = 0;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_first);

        kClassCount += 1;

        TextView textView = (TextView) findViewById(R.id.textView);

        textView.setText(Integer.toString(kClassCount));

        Button button = (Button) findViewById(R.id.button);

        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

//                Intent intent = new Intent(FirstActivity.this, SecondActivity.class);
//                startActivity(intent);

                SecondActivity.actionStart(FirstActivity.this);

            }
        });

    }

    @Override
    protected void onDestroy() {
        super.onDestroy();

        kClassCount -= 1;
    }
}
